package com.itheima.tcp.Demo3;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ServerThreadPool {
    public static void main(String[] args) throws IOException {
        ServerSocket socket = new ServerSocket(10000);
        ExecutorService service = Executors.newFixedThreadPool(10);
        while(true){
            Socket accept = socket.accept();
            Client c = new Client(accept);
            service.submit(c);
        }
    }
}
